<?
$data["jss"] = array("jqueryFileTree.js","player.js",$pc_type."/main.js","jquery-ui-1.8.12.custom.min.js");
$data["csss"] = array("jqueryFileTree.css","player.css","slider/jquery-ui-1.8.12.custom.css");
$embed_w = 600;
$embed_h = 450;
if($pc_type=='pc'){
	$data["csss"][]="pc/style.css";
	$embed_w = 400;
	$embed_h = 300;
}
$this->load->view('header',$data);
$base_url = base_url();
?>
<script type="text/javascript">
	channel_id = "<?= $channel_id; ?>";
	channel_name = "<?= $channel_name; ?>";
	channel_dsc = "<?= $channel_dsc; ?>";
	preferencias = <?= json_encode($prefs);?>;
</script>
<div>
	<div id="header">
		<ul id="nav">
			<li onclick="init_busqueda();" id="li_busqueda"><span>Canales</span></li>
			<li onclick="init_local_player();" id="li_local_player"><span>Reproductor</span></li>
			<?
			if(isset($broadcast_data)){
				echo '<li onclick="init_broadcaster();" id="li_broadcaster" ><span>Emitir</span></li>';
			}
			if($user->is_admin){
				echo "<li>".anchor("backend/admin/","<span>Administraci&oacute;n</span>",'title=""')."</li>";
			}
			?>
		</ul>
		<div class="div_inlinesearch">
			<img src="<?= $base_url; ?>images/busqueda/lupita2.png" alt="">
			<input id="text_busq" type="text" autocomplete="off" onkeydown="if(!this.disabled && event.keyCode==13)buscarCanales2(1,1);">
		</div>
	</div>
	<div id="panel_busqueda">
		<div id="main_div_busq" style="width: 100%;height: 100%;">
		</div>
	</div>
        <div id="backend" style="width: 100%; height: 100%; display: none;">
        </div>
	<div id="main_container">

		<div id="main_container_embed">
			<label id="rol_label" class="tab-top tab">Reproductor de Canales</label>
			<div id="div_embed">
				<EMBED	id="goalbit" type="application/x-goalbit-plugin"
					   width="<?= $embed_w ?>" height="<?= $embed_h ?>" b_yourself="false"
						<? if(isset($broadcast_data)){
						echo 'broadcast_prof="true" auto_broad_type="4"';
						echo 'controller-url="'. $broadcast_data["controller_url"].'"';
						echo 'certs-url="'. $broadcast_data["certificates_url"].'"';
						echo 'cn-suffix="'. $broadcast_data["xmltv_id"].'"';
						}?>
				</EMBED>
			</div>
                        <div id="slider_container" style="background-color: black;width: 100%;padding: 5px 0;">
                        <div id="slider" style="margin: 0 15px;"></div>
                        </div>
			<div class="player-bar">
				<button id="btn_player_play" onclick="play();" class="play"></button>
				<button id="btn_player_stop" onclick="stop();" class="stop"></button>
				<button onclick="prev();" class="prev playlist_nav"></button>
				<button onclick="next();" class="next playlist_nav"></button>
			</div>
			<label id="state_label" class="tab-bottom_right tab">Estado</label>
		</div>

		<div id="main_container_info">
                    <label id="pl_label" class="tab-top tab" style="width:100%;">Lista de reproducci&oacute;n</label>
                    <div class="panel_container">
                        <div id="playlist" style="display:none">
                                <ul id="playlist_ul">
                                        <li class="instructions">
                                                <p>Esta vacia.</p>
                                        </li>
                                </ul>
                                <input disabled="" type="text" id="location_data_folder"><button id="btn_browse" onclick="browse_folder();" class="buton-bar ui-corner-all">...</button>
                        </div>
                        <div id="broadcast_info" style="display:none;padding:0 5px;">
                                <table width="100%">
                                        <tr><td class="label">Nombre del canal:</td></tr>
                                        <tr><td class="data"><input type="text" id="bchannel_name" autocomplete="off"></td></tr>
                                        <tr><td class="label">Descripci&oacute;n del canal:</td></tr>
                                        <tr><td class="data"><textarea id="bchannel_dsc" rows="5" autocomplete="off"></textarea></td></tr>
                                        <tr><td align="right"><button onclick="modify_channel();">Guardar</button></td></tr>
                                </table>
                        </div>
                        <div id="channel_info" style="display:none;padding:0 5px;">
                                <span id="pchannel_dsc"></span>
                                <div style="bottom: 25px;right:0; position: absolute;" align="right">
                                        <button title="El contenido del canal me ofende" onclick="markOfensiveChannel();">Me Ofende!</button>
                                </div>
                        </div>
                    </div>
                    <label class="tab-bottom tab" style="width:100%;">&nbsp;</label>
		</div>
	</div>
</div>

<div id="choose_file" class="jqmWindow">
	<div class='modal_cont'>
		<div id="files_chooser" class="panel_container">
		</div>
		<table style="width:100%;" cellspacing="4">
			<tr>
				<td>Filtro:</td>
				<td><input type="text" id="choose_fileExtension" style="width: 100%;" value="mpg,mp3,ogg,avi,mp4"></td>
				<td width="35px"><input type="button" value="ok" onclick="end_browse_folder();"></td>
			</tr>
		</table>
	</div>
</div>
<div id="div_ofende" class="jqmWindow">
	<div class='modal_cont'>
		<textarea id="txta_ofende" cols="50" rows="7" ></textarea>
		<table style="width:100%;">
			<tr>
				<td align="right"><input type="button" value="ok" onclick="markOfensiveChannel2();"></td>
			</tr>
		</table>
	</div>
</div>

<? $this->load->view('footer'); ?>
